<%@ include file="/WEB-INF/jspf/directive/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<c:set var="title">
	<fmt:message key="blockedaccs.title.text" />
</c:set>
<%@ include file="/WEB-INF/jspf/head.jspf"%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
</head>
<body>
	<div class="container">
		<c:choose>
			<c:when test="${fn:length(accounts) == 0}">
				<h3><fmt:message key="blockedaccs.label.noaccs" /></h3>
				<br />
			</c:when>

			<c:otherwise>
				<h3><fmt:message key="blockedaccs.label.blocked" />:</h3>
				<table class="table table-bordered">
					<thead>
						<tr>
							<td><fmt:message key="blockedaccs.label.user" /></td>
							<td><fmt:message key="blockedaccs.label.accountuid" /></td>
							<td><fmt:message key="blockedaccs.label.balance" /></td>
							<td><fmt:message key="blockedaccs.label.valutatype" /></td>
							<td><fmt:message key="blockedaccs.label.state" /></td>
							<td><fmt:message key="blockedaccs.label.actions" /></td>
						</tr>
					</thead>
					<c:forEach var="account" items="${sessionScope['accounts']}">
						<tr>
							<td><c:out value="${account.user.login}"></c:out></td>
							<td><c:out value="${account.id}"></c:out></td>
							<td><c:out value="${account.balance}"></c:out></td>
							<td><c:out value="${account.valuta.shortName}"></c:out></td>
							<td><c:out value="${account.accountState}"></c:out></td>
							<td>
								<form action="controller" name="formView${account.id}">
									<input type="hidden" name="command" value="unblockAccount">
									<input type="hidden" name="id"
										value=<c:out value="${account.id}"></c:out>> <a
										href=""
										onclick="document.forms['formView${account.id}'].submit(); return false;">
										<fmt:message key="blockedaccs.button.unblock" /> </a>
								</form>
							</td>
						</tr>
					</c:forEach>

				</table>

			</c:otherwise>
		</c:choose>

		<a href="controller?command=browseAdminPage"
			class="btn btn-large btn-block"> 
			<fmt:message key="blockedaccs.button.back" />
		</a>
	</div>
</body>
</html>